<#include "app/contract/filters/filter-for-contract-sign-list.ftl">

<table class="table-contract-list" data-page="${page!1}" data-page="${page!'1'}" data-count="${count!'0'}" data-page-size="${pageSize!'30'}">
	<tr class="title-row">
		<th class="text-center" width="45">序号</th>
		<th class="text-center">合同编号</th>
		<th class="text-center">合同名称</th>
		<th class="text-center">签约方</th>
		<th class="text-center">合同金额（元）/降点%</th>
		<th class="text-center">合同工期</th>
		<th class="text-center">完成情况</th>
		<th class="text-center">办结日期</th>
		<th class="text-center">备注</th>
	</tr>
	<#if data??> <#list data as c>
	<tr onclick="window.open('${request.contextPath}/contract/view/${c.id}','_blank');" style="cursor: pointer;">
		<td class="text-center">${c_index + 1}</td>
		<td class="text-center">${c.no}</td>
		<td class="text-center">${c.name}</td>
		<td class="text-center">${c.qyf}</td>
		<td class="text-center">${c.priceString}</td>
		<td class="text-center">${(c.contractStart?string('yyyy-MM-dd')+' 至 '+c.contractEnd?string('yyyy-MM-dd'))!''}${(c.contractDays)!''}</td>
		<td class="text-center">${(('FS2000_CONTRACT_TO_CREATE'==c.flowStatus)?string('未完成','已完成'))!'-'}</td>
		<td class="text-center">${(c.bjTime?string('yyyy-MM-dd'))!'-'}</td>
		<td class="text-center">${c.remark!'-'}</td>
	</tr>
	</#list> </#if>
</table>
<script src="${request.contextPath}/js/suredy-list.js"></script>
<script src="${request.contextPath}/js/suredy-datetimepicker.js"></script>
<script src="${request.contextPath}/core/js/jquery.form.js"></script>
<script type="text/javascript">
	$(function() {
		$.suredy.datetimepicker.init();

		var doSearch = function(page, pageSize) {
			var form = $('form.filter-form');

			form.ajaxSubmit({
				dataType : 'html',
				data : {
					page : page,
					pageSize : pageSize
				},
				success : function(html, textStatus, jqXHR) {
					if (!html)
						return false;

					$('div.suredy-content').html(html);
				},
				error : function(jqXHR, textStatus, errorThrown) {
					return false;
				}
			});
		};

		$('table.table-contract-list').list({
			header : false,
			paginate : function(page, pageSize, key) {
				doSearch(page, pageSize);
			}
		});

		$('.filter-search').on('click', function() {
			doSearch(1, $('table.table-contract-list').data('page-size'));
		});

		$('.filter-reset').on('click', function() {
			$('form.filter-form input').val('');
			$('form.filter-form option:first-child').prop('selected', true);
		});
	});
</script>
